GtkCssProvider: Use default value when handling "none".
authorCarlos Garnacho <carlosg@gnome.org>
Sun, 21 Nov 2010 18:36:59 +0000 (19:36 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:39:22 +0000 (15:39 +0100)
This way the default value has a way to override other values in previous
GtkStyleProviders when merged.

gtk/gtkcssprovider.c

index 31b28727fac9637fb85643d90fce21fe385044f8..704ca927747083385dac9112199ec63dc4926aa4 100644 (file)
@@ -2964,8 +2964,11 @@ parse_rule (GtkCssProvider *css_provider,
 
           if (strcmp (value_str, "none") == 0)
             {
-              /* Remove/unset the current value */
-              g_hash_table_remove (priv->cur_properties, prop);
+              /* Insert the default value, so it has an opportunity
+               * to override other style providers when merged
+               */
+              g_param_value_set_default (pspec, val);
+              g_hash_table_insert (priv->cur_properties, prop, val);
             }
           else if (pspec->value_type == G_TYPE_STRING)
             {